package com.airsystem.pos.bengkel.model;

import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.airsystem.pos.bengkel.component.DesktopFrame;
import com.airsystem.pos.bengkel.entity.JenisTagihan;

/**
 * @author Fanny Irawan Sutawanir (fannyirawans@gmail.com)
 */
public class MasterBillingModel extends DesktopFrame {
	protected GridBagLayout baseLayout = new GridBagLayout();
	protected GridBagLayout panelLayout = new GridBagLayout();

	protected JPanel basePanel = new JPanel();
	protected JPanel buttonPanel = new JPanel();

	protected JLabel namaLabel = new JLabel();

	protected JTextField namaField = new JTextField();
	protected JTextField idField = new JTextField();

	protected JButton searchButton = new JButton();
	protected JButton saveButton = new JButton();
	protected JButton updateButton = new JButton();
	protected JButton deleteButton = new JButton();
	protected JButton cancelButton = new JButton();

	protected JenisTagihan jenisTagihan;

	public MasterBillingModel() {
		super();
	}

	protected JenisTagihan getComponentData() {
		JenisTagihan jenisTagihan = new JenisTagihan();
		jenisTagihan.setId(idField.getText().isEmpty() ? null : Long.valueOf(idField.getText().trim()));
		jenisTagihan.setNama(namaField.getText().trim());

		return jenisTagihan;
	}
}